<?php

namespace App\Http\Requests\Order;

use App\Http\Requests\BasicFormRequests;

class OrderRequest extends BasicFormRequests
{
    protected $rule =[
        'address_id' => 'required' ,
        'pay_type' => 'required',
        'prefix' => 'required',
        'order_ids' => 'required'
    ];

    public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
    {
        $this->message = [
            'address_id.required'=>trans('message.address_err'),

            'pay_type.required'=>trans('message.pay_type_err',[
                'code' => 1001
            ]),

            'prefix.required'=>trans('message.pay_type_err',[
                'code' => 1002
            ]),

            'order_ids.required'=>trans('message.request_required',[
                'name' => trans('key.order')
            ])
        ];
        parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
    }


    protected $scene = [
        'create' => ['address_id','pay_type','prefix'],
        'delete' => ['order_ids']
    ];
}
